package com.rgs.se.sort;



/**
 * @program: study-algorithm
 * @description:
 * @author: Mr.Ren
 * @create: 2022-10-19 16:29
 **/
public class _1SleepSort {
    public static void sleepSort(int[] arr) {
        SleepThread[] sleepThread = new SleepThread[arr.length];

        //线程赋值
        for (int i = 0; i < arr.length; i++) {
            sleepThread[i] = new SleepThread(arr[i]);
        }

        //启动线程
        for (int i = 0; i < arr.length; i++) {
            sleepThread[i].start();
        }

    }


    public static void main(String[] args) {
        int[] arr = {11, 8, 3, 15, 7, 5, 26, 39, 23, 15};
        System.out.println("排序前的数组为：");
        SortUtil.Print(arr);
        sleepSort(arr);
    }
}
